package com.shanpin.shebao.admin.order.model;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.shanpin.core.constant.OrderConst;
import com.shanpin.core.utils.DateUtil;

/**
 * 对应补缴差额表 t_sb_buy_order_added
 * @author 品讯科技
 *
 */
public class OrderAdded {
	
	private String added_no;
	private String title;
	private int pay_uid;
	private String id_card;
	private int city_code;
	private String reason;
	private Double amount;
	private String orders;
	private String months;
	private String pay_no;
	private int status;
	private String gen_time;
	private String pay_time = "";
	
	private String user_name;
	private String city_name;
	private String phone;
	private String status_name;

	public static RowMapper<OrderAdded> listMapper = new RowMapper<OrderAdded>() {

		@Override
		public OrderAdded mapRow(ResultSet rs, int rowNum) throws SQLException {
			OrderAdded pojo = new OrderAdded();
			pojo.added_no = rs.getString("added_no");
			pojo.title = rs.getString("title");
			pojo.pay_uid = rs.getInt("pay_uid");
			pojo.id_card = rs.getString("id_card");
			pojo.user_name = rs.getString("user_name");
			pojo.city_code = rs.getInt("city_code");
			pojo.reason = rs.getString("reason");
			pojo.amount = rs.getDouble("amount");
			pojo.orders = rs.getString("orders");
			pojo.months = rs.getString("months");
			pojo.pay_no = rs.getString("pay_no");
			pojo.status = rs.getInt("status");
			pojo.gen_time = DateUtil.stringWithDate(rs.getTimestamp("gen_time"));
			if (pojo.getStatus() > OrderConst.PRE_PAY.getNum()) {
				pojo.pay_time = DateUtil.stringWithDate(rs.getTimestamp("pay_time"));
			}
			pojo.phone = rs.getString("phone");
			return pojo;
		}
	};
	

	public static RowMapper<OrderAdded> mapper = new RowMapper<OrderAdded>() {

		@Override
		public OrderAdded mapRow(ResultSet rs, int rowNum) throws SQLException {
			OrderAdded pojo = new OrderAdded();
			pojo.added_no = rs.getString("added_no");
			pojo.title = rs.getString("title");
			pojo.pay_uid = rs.getInt("pay_uid");
			pojo.id_card = rs.getString("id_card");
			pojo.city_code = rs.getInt("city_code");
			pojo.reason = rs.getString("reason");
			pojo.amount = rs.getDouble("amount");
			pojo.orders = rs.getString("orders");
			pojo.months = rs.getString("months");
			pojo.pay_no = rs.getString("pay_no");
			pojo.status = rs.getInt("status");
			return pojo;
		}
	};
	
	

	public String getAdded_no() {
		return added_no;
	}

	public void setAdded_no(String added_no) {
		this.added_no = added_no;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getPay_uid() {
		return pay_uid;
	}

	public void setPay_uid(int pay_uid) {
		this.pay_uid = pay_uid;
	}

	public String getId_card() {
		return id_card;
	}

	public String getUser_name() {
		return user_name;
	}

	public void setUser_name(String user_name) {
		this.user_name = user_name;
	}

	public void setId_card(String id_card) {
		this.id_card = id_card;
	}

	public int getCity_code() {
		return city_code;
	}

	public void setCity_code(int city_code) {
		this.city_code = city_code;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public String getOrders() {
		return orders;
	}

	public void setOrders(String orders) {
		this.orders = orders;
	}

	public String getMonths() {
		return months;
	}

	public void setMonths(String months) {
		this.months = months;
	}

	public String getPay_no() {
		return pay_no;
	}

	public void setPay_no(String pay_no) {
		this.pay_no = pay_no;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getGen_time() {
		return gen_time;
	}

	public void setGen_time(String gen_time) {
		this.gen_time = gen_time;
	}

	public String getPay_time() {
		return pay_time;
	}

	public void setPay_time(String pay_time) {
		this.pay_time = pay_time;
	}

	public String getCity_name() {
		return city_name;
	}

	public void setCity_name(String city_name) {
		this.city_name = city_name;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getStatus_name() {
		return status_name;
	}

	public void setStatus_name(String status_name) {
		this.status_name = status_name;
	}
}
